package br.unifor.g2cl;


/**
 * 
 * Used to perform specific tasks on a message before it is sent and after it is received.
 * 
 * @author Leandro Sales (leandro.shp@gmail.com)
 *
 */
public interface DataSessionWorker {
	
	/**
	 * Task to be performed on a message before it is sent.
	 * 
	 * @param data - message to be sent represented as a byte array
	 * 
	 * @return - parsed message
	 */
	public byte[] doIt(byte[] data);

	/**
	 * Task to be performed on a message after it is received. Probably will undo what was done at
	 * the doIt method
	 * 
	 * @param data - message received as a byte array
	 * 
	 * @return - raw message
	 */
	public byte[] undoIt(byte[] data);

}
